package com.fanbuchi.app.ins.utils;

import com.fanbuchi.app.ins.event.NetEvent;
import com.fanbuchi.app.ins.event.NetonCompletedEvent;
import com.fanbuchi.app.ins.event.NetonErrorEvent;
import com.fanbuchi.app.ins.event.NetonStartEvent;
import com.fanbuchi.app.ins.vo.enums.AsyncStatus;

import de.greenrobot.event.EventBus;
import rx.Subscriber;

/**
 * Created by win7 on 2016/5/26.
 */
public abstract  class SimpleSubscriber<T> extends Subscriber<T> {
    @Override
    public void onCompleted() {
        EventBus.getDefault().post(new NetonCompletedEvent());
    }

    @Override
    public void onError(Throwable e) {
        EventBus.getDefault().post(new NetonErrorEvent(e));
    }

    @Override
    public void onStart() {
        super.onStart();
        EventBus.getDefault().post(new NetonStartEvent());
    }
}
